package com.huawei.java.main.classes;

public class Migration {
    private final int ServiceId;
    private final int ServerId;
    private final Boolean deployA;

    public Migration(int serviceId, int serverId, Boolean deployA) {
        this.ServerId = serverId;
        this.ServiceId = serviceId;
        this.deployA = deployA;
    }

    @Override
    public String toString() {
        if (deployA != null) {
            return String.format("(%d, %d, %s)",
                    this.ServiceId,
                    this.ServerId,
                    this.deployA ? "A" : "B");
        } else {
            return String.format("(%d, %d)",
                    this.ServiceId,
                    this.ServerId);
        }
    }
}
